package com.songlanyun.modules.studyingLately.entity;


import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.songlanyun.common.drive.RootEntity;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@TableName(value = "yxt_studying_lately")
@Data
public class StudyingLately extends RootEntity<Long, StudyingLately> implements Serializable {



    /**
     * id
     */
    @TableId
    private Long id;
    /**
     * 所属课程
     */
    @NotNull(message = "用户Id不能为空")
    private Long userId;
    /**
     * 课程Id
     */
    @NotEmpty(message = "课程Id不能为空")
    private Long studyingId;
    /**
     *
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Override
    public Long getIdentity() {
        return getId();
    }
}
